<template>
  <div>
    <dl class="fly-panel fly-list-one">
      <dt class="fly-panel-title">本周热议</dt>
      <dd v-for="(item, index) in list" :key="'hotlist' + index">
        <a href="jie/detail.html">{{ item.title }}</a>
        <span>
          <i class="iconfont icon-pinglun1"></i> {{ item.answer }}
        </span>
      </dd>
      <div v-if="!list.length" class="fly-none">没有相关数据</div>
    </dl>
  </div>
</template>

<script>
import { getTopWeek } from '@/api/content'
export default {
  name: 'HotList',
  data () {
    return {
      list: []
    }
  },
  created () {
    this.fetchTop()
  },
  methods: {
    async fetchTop () {
      const res = await getTopWeek()
      if (res.code === 200) {
        this.list = res.data
      }
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
